<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title><!--旅客候补--></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/project/ui-res-v3.css">
    <link rel="stylesheet" href="css/project/ui-input-v3.css">
    <link rel="stylesheet" href="css/project/ui-color-v3.css">
	<link rel="stylesheet" href="css/project/style.css">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
	<link rel="stylesheet" href="css/zv_common.css">
	<link rel="stylesheet" href="css/iBox.css?v=202022">
    <link rel="stylesheet" href="css/appcan.control.css">
    <script src="js/zy_control.js"></script>
    <script src="js/zy_click.js"></script>
	<script src="js/jquery-3.1.1.min.js?v=202021"></script>
	<script src="js/main.js"></script>
	<script src="js/init.js"></script>
    <script type="text/javascript" src="js/JsonSQL/jsonsql-0.1.js"></script>
	<script src="js/iBox.js?v=202022"></script>
	<script src="js/appcan.min.js"></script>
	<script src="js/candidate.js"></script>
	<script src="js/talkingdata.js"></script>
	<style>
	 	.line-h
		{
 			 padding: 0.1em 0.3em 0.1em 0.3em;
			 border-bottom:solid #cccccc 1px;
		}
		.umwh
		{
			min-width: 1.5em;
			min-height: 1.5em;
		}
	 </style>
</head>
<body class="um-vp nobg " ontouchstart style="background:#FFFFFF">
<div id="page_1" class="ub ub-ver um-vp">
<div class="ub ub-ver ">
	<div class="line-h   c-wh">
   	 <div class="ub ulab ub-ac umh1 " >
			<div class="umw4 ">姓名：</div>
			<div class="uba ub-f1 b-bla uinput uc-a1 noboder nobg" style="padding-left:0.5em; padding-right:0.5em">
		            	<input placeholder="" type="text"   id="paxname"  style="width:100%; height:1.8em; border:0px;outline:none " class="t-gra"  value="">
			</div>
		</div>
	</div>
	<div class="line-h  c-wh">
	<!--下拉列表开始-->
	<div class="ub t-bla ub-ac  nobg">
	    <div class="ulim umw4 umar-r">舱位：</div>
	    <div class="ub-f1 ub uba  b-gra  sel noboder">
			<!--复选框开始-->
			<input type="checkbox" name="che1" class="uhide"  value="Y"  id="cabin_Y" checked="checked">
			<div onclick="zy_for(event)" ontouchstart="zy_touch('btn-act')" class="ub uc-a1 t-bla">
			    <div class="che-icon ub-img umwh"></div>
			</div>
			<!--复选框结束-->
			<div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel">经济舱</div>
			<!--复选框开始-->
			<input type="checkbox" name="che1" class="uhide"  value="W" id="cabin_W">
			<div onclick="zy_for(event)" ontouchstart="zy_touch('btn-act')" class="ub uc-a1 t-bla">
			    <div class="che-icon ub-img umwh"></div>
			</div>
			<!--复选框结束-->
			<div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel">超级经济舱</div>
	    </div>
	</div>
	<!--下拉列表结束-->
	<!--下拉列表开始-->
	<div class="ub t-bla ub-ac nobg">
	    <div class="ulim umw4 umar-r">&nbsp;&nbsp;</div>
	    <div class="ub-f1 ub uba  b-gra  sel noboder">
			<!--复选框开始-->
			<input type="checkbox" name="che1" class="uhide"  value="J" id="cabin_J" >
			<div onclick="zy_for(event)" ontouchstart="zy_touch('btn-act')" class="ub uc-a1 t-bla">
			    <div class="che-icon ub-img umwh"></div>
			</div>
			<!--复选框结束-->
			<div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel">公务舱</div>
			<!--复选框开始-->
			<input type="checkbox" name="che1" class="uhide"  value="F" id="cabin_F" >
			<div onclick="zy_for(event)" ontouchstart="zy_touch('btn-act')" class="ub uc-a1 t-bla">
			    <div class="che-icon ub-img umwh"></div>
			</div>
			<!--复选框结束-->
			<div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel">头等舱 &nbsp;&nbsp;&nbsp;  </div>
	    </div>
	</div>
	<!--下拉列表结束-->
	<!--下拉列表开始-->
	<div class="ub t-bla ub-ac nobg">
	    <div class="ulim umw4 umar-r">&nbsp;&nbsp;</div>
	    <div class="ub-f1 ub uba  b-gra  sel noboder">
			<!--复选框开始-->
			<input type="checkbox" name="che1" class="uhide"  value="U" id="cabin_U" >
			<div onclick="zy_for(event)" ontouchstart="zy_touch('btn-act')" class="ub uc-a1 t-bla">
			    <div class="che-icon ub-img umwh"></div>
			</div>
			<!--复选框结束-->
			<div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel">豪华头等舱</div>
	    </div>
	</div>
	<!--下拉列表结束-->
   </div>
      <div class="line-h  c-wh">
	<!--下拉列表开始-->
	<div class="ub t-bla ub-ac umar-t nobg">
	    <div class="ulim umw4 umar-r">承运人：</div>
	    <div class="ub-f1 ub uba  b-gra  sel noboder">
	        <div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel" id="carrier">MU</div>
	        <div class="b-gra  umw2 ub ub-pc ub-ac">
	            <div class="ub-img umw1 umh1 res3"></div>
	        </div>
	          <select name="Carrier" selectedindex="0" id="Carrier" onchange="zy_selectmenu(this.id)">
	         		<option value="MU">MU</option>
                    <option value="FM">FM</option>
                    <option value="KN">KN</option>
			 </select>
	    </div>
	</div>
	<!--下拉列表结束-->
   </div>
   
   <div class="line-h   c-wh">
   	 <div class="ub ulab ub-ac umh1 umar-t " >
			<div class="umw4 ">航班号：</div>
			<div class="uba ub-f1 b-bla uinput uc-a1 noboder nobg" style="padding-left:0.5em; padding-right:0.5em">
		            	<input placeholder="" type="tel"   id="flightNo"  style="width:100%; height:1.8em; border:0px;outline:none " class="t-gra"  value="">
			</div>
		</div>
	</div>
	<div class="line-h   c-wh">
   	 <div class="ub ulab ub-ac umh1 umar-t " >
			<div class="umw4 ">证件号码：</div>
			<div class="uba ub-f1 b-bla uinput uc-a1 noboder nobg" style="padding-left:0.5em; padding-right:0.5em">
		            	<input placeholder="" type=""   id="idNum"  style="width:100%; height:1.8em; border:0px;outline:none " class="t-gra"  value="" onkeyup="check(this)" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"  onkeydown="if(event.keyCode==13)event.keyCode=9" onchange="check(this)">
			</div>
		</div>
	</div>
	<div class="line-h   c-wh">
	    <div class='ub umar-t ub-ac' >
		<div class=" ub-ac　ulim ulev0 umw4" style="height:2em; line-height:2em">航班日期：</div>
		 <div class="ub ub-f1 uba ub-ac b-bla b-norarea   noboder nobg" >
	 	<div class="ub-f1 ut-s uinn   tx-l t-gra ulh-sel " id="flightDate" style="width:100%;" onclick="checked_day('flightDate')">请选择开始日期</div>
	    </div>
	</div>
	</div>
<div class="line-h   c-wh">
   	 <div class="ub ulab ub-ac umh1 umar-t " >
			<div class="umw4 ">出发机场3字码：</div>
			<div class="uba ub-f1 b-bla uinput uc-a1 noboder nobg" style="padding-left:0.5em; padding-right:0.5em">
		            	<input placeholder="SHA" type="text"   id="oriEng"  style="width:100%; height:1.8em; border:0px;outline:none " class="t-gra"  value="">
			</div>
		</div>
	</div>
	<div class="line-h   c-wh">
   	 <div class="ub ulab ub-ac umh1 umar-t " >
			<div class="umw4 ">到达机场3字码：</div>
			<div class="uba ub-f1 b-bla uinput uc-a1 noboder nobg" style="padding-left:0.5em; padding-right:0.5em">
		            	<input placeholder="PEK" type="text"   id="desEng"  style="width:100%; height:1.8em; border:0px;outline:none " class="t-gra"  value="">
			</div>
		</div>
	</div>
<!--提交按钮-->
<div ontouchstart="zy_touch('zv-btn-act')" class="zvbtn  c-blu1  t-wh tx-c uc-a1 zvbtnpadding"   onclick="submitStep()" >下一步</div>
</div>

</div>
</body>
<script>
zy_init();
window.uexOnload=function(type){
	if(!type){
		uexWindow.setBounce("0");
		initData();
		IC.talkingDataCount("旅客候补","0001");
	}
}
function initData()
{
//	alert($$("Carrier").selectedIndex);
	 $$("paxname").value=''; /*姓名*/
//	 $$("subClasslv").innerHTML='经济舱'; /*仓位div*/
//	 $$("SubClasslv").selectedIndex=0; /*仓位*/
	 $$("carrier").innerHTML='MU'; /*承运人div*/
	 $$("Carrier").selectedIndex=0; /*承运人*/
	 $$("flightNo").value=''; /*航班号*/
	 $$("idNum").value=''; /*证件号码*/
	 $$("flightDate").innerHTML = getNowFormatDate().substr(0,11);/*航班日期*/
	 $$("oriEng").value=''; /*出发机场3字码*/
	 $$("desEng").value=''; /*到达机场3字码*/
}
/**
 * 发送表单数据
 */
function sendData()
{
	var paxname = $$("paxname").value; /*姓名*/
//	var SubClasslv = $$("SubClasslv").value; /*仓位*/
	var Carrier = $$("Carrier").value; /*承运人*/
	var flightNo = $$("flightNo").value; /*航班号*/
	var idNum = $$("idNum").value; /*证件号码*/
	var flightDate=$$("flightDate").innerHTML;/*航班日期*/
	var oriEng1 = $$("oriEng").value==""?"SHA":$$("oriEng").value; /*出发机场3字码*/
	var oriEng=oriEng1.toUpperCase();
	var desEng1 = $$("desEng").value==""?"PEK":$$("desEng").value; /*到达机场3字码*/
	var desEng=desEng1.toUpperCase();
	var imei=getDevice()==""?"340403199003170612":getDevice();
	paxname=native2ascii(paxname);
	var arr=['cabin_Y','cabin_U','cabin_J','cabin_W','cabin_F'];
	var SubClasslv='';
	SubClasslv=judgeChecked(arr);
	
	if(SubClasslv=='')
	{
		$alert("请选择舱位！");
		return;
	}
	var url = "http://jx.selfservice.ceair.com:6080/mckiserver/service/v1/sample/CandidateInput";
 //alert(flightDate);
var paramList = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><candidatePassenger><paxname><![CDATA["+paxname+"]]></paxname><idNum><![CDATA["+idNum+"]]></idNum><carrier><![CDATA["+Carrier+"]]></carrier><flightNo><![CDATA["+flightNo+"]]></flightNo><depDt><![CDATA["+flightDate+"]]></depDt><oriEng><![CDATA["+oriEng+"]]></oriEng><desEng><![CDATA["+desEng+"]]></desEng><subclassLv><![CDATA["+SubClasslv+"]]></subclassLv><username><![CDATA["+username+"]]></username><password><![CDATA["+password+"]]></password><imei><![CDATA["+imei+"]]></imei></candidatePassenger>";
console.log(paramList);
//return;
$.iBoxWait();
			$.ajax({
				type: "POST",
				contentType: "text/xml; charset=utf-8",
				url: url,
				data: paramList,
				datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
				success: function(json){
					$.iBoxHide(); 
					//alert(JSON.stringify(json))
					//alert(flightDate)
					if(json.candidateOutputBean.errorCodeM==0)
					{
						$alert("提交成功！")
					}
					else{
						$alert(json.candidateOutputBean.errorMsgM)
					}
				},
				//调用出错执行的函数
				error: function(err){
					$alert("查询错误！");
				}
			});
}

/**
 * 下一步按钮提交数据
 */
function submitStep()
{
	sendData();
//	initData();   //重置
	IC.talkingDataCount("旅客候补","0001");
}

function check(obj)
{
	obj.value = obj.value.replace(/[^\w\.\/]/ig,'');
}

function CandidateUpgrade()
	{
		openNewWin('candidateList','candidateList.html');
		IC.talkingDataCount("旅客候补","0001");
	}
</script>
</html>
